{% extends 'base/base.html' %}
{% block title %} 域名管理 {% endblock title %}
{% block stylesheets %}
    {{ block.super }}
{% endblock %}
{% block content %}
<div class="right_col" role="main">
    <div class="">
        <div class="clearfix"></div>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <a href="{% url 'domain_add' %}" style="float:left;" class="btn btn-info btn-sm" role="button" ><i class="fa fa-plus"></i></a>
                        <div class="loading"></div>
                        <h2>域名管理 </h2>
                        <ul class="nav navbar-right panel_toolbox">
                            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                            </li>
                            <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Settings 1</a>
                                </li>
                                <li><a href="#">Settings 2</a>
                                </li>
                            </ul>
                            </li>
                            <li><a class="close-link"><i class="fa fa-close"></i></a>
                            </li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                        <form class="form-horizontal form-border" method="get" action="" name="formName">
                    <div class="x_content table-responsive" style="border:none">
                        <table id="datatable" class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>Sub Domain</th>
                                    <th>IP</th>
                                    <th>Domain</th>
{#                                    <th>微信</th>#}
{#                                    {% if perms.asset.edit_asset %}#}
                                    <th>操作</th>
{#                                    {% endif %}#}
                                </tr>
                            </thead>
                            <tbody>
                                {% for each in DomainList %}
                                <tr>
                                    <td>{{ each.subdomain }}</td>
                                    <td>{{ each.ipaddress }}</td>
                                    <td>{{ each.domain }}</td>
{#                                    <td>{{ each.weChat }}</td>#}
{#                                    {% if perms.asset.edit_asset %}#}
                                    <td>
                                            <a href="{% url 'domain_manage' aid=each.pk action='edit' %}" class="btn btn-success btn-sm" role="button"><i class="fa fa-edit"></i></a>
                                            <a href="#"  data-toggle="modal" data-target="#reqDelete-{{ each.pk }}" class="btn btn-danger btn-sm" role="button"><i class="fa fa-trash-o "></i></a>
                                    </td>
{#                                    {% endif %}#}
                                <!-- 模态框（Modal） -->
                                    <div class="modal fade" id="reqDelete-{{ each.pk }}" tabindex="-1" role="dialog" aria-labelledby="reqDelete" aria-hidden="true">
                                        <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                                    <h4 class="modal-title" id="reqDelete">提示</h4>
                                                </div>
                                                <div class="modal-body">
                                                    确认是否删除？
                                                    <div><br /><strong>{{ each.name }}</strong></div>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">关闭</button>
                                                    <a style="margin:4px;" class="btn btn-danger btn-sm" href="{% url 'domain_manage' aid=each.pk action='delete' %}">删除</a>
                                                </div>
                                            </div><!-- /.modal-content -->
                                        </div><!-- /.modal-dialog -->
                                    </div><!-- /.modal -->
                                </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    </form>
                    {% comment %}                {% if request.user.is_superuser %}
                <button name="load_city" class="btn btn-info btn-sm" style="margin-left:5px;">载入城市数据</button>
                <span>如果机房位置无城市选择，则需加载省市区数据</span>
                <div id="notice_id"></div>
                {% endif %}{% endcomment %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
{% block javascripts %}
    {{ block.super }}
{% endblock %}